package com.i5tong.daogenerator;

import java.util.List;

import de.greenrobot.daogenerator.DaoGenerator;
import de.greenrobot.daogenerator.Entity;
import de.greenrobot.daogenerator.Schema;

public class MyDaoGenerator {

    public static void main(String[] args) throws Exception {
        Schema schema = new Schema(1, "com.i5tong.greendaodemo.model");
        schema.setDefaultJavaPackageDao("com.i5tong.greendaodemo.dao");
        schema.enableKeepSectionsByDefault();
        addUser(schema);

        new DaoGenerator().generateAll(schema, "../app/src/main/java/");
    }

    private static void addUser(Schema schema) {
        Entity user = schema.addEntity("User");
        user.addIdProperty().autoincrement();
        user.addStringProperty("username").notNull();
        user.addStringProperty("nickname").notNull();
        user.addDateProperty("birthday").notNull();
        user.addIntProperty("gender").notNull();

    }


}
